package com.deprice4u;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ListView;

public class Listview_testActivity extends Activity {
	
	static String m_tag = "[TAG]";
	private EditText txtInput = null;
	private SocialSearcher mSearcher;
	private ListView mLVSearchResult;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        txtInput = (EditText)this.findViewById(R.id.etSearchInput);
        mSearcher = new SocialSearcher();
        mLVSearchResult = (ListView)this.findViewById(R.id.lSearchResult);
    }
    
    public void onbtnSearchClick(View v){
    	String strKeyword = txtInput.getText().toString();
    	ArrayList<SocialData> maListItems = mSearcher.searchByKeyword(strKeyword, 0, 10);
    	SocialSearchAdapter adapter = new SocialSearchAdapter(this, R.layout.searchitem, maListItems);
    	mLVSearchResult.setAdapter(adapter);
    	
    }
}